import React, { Component } from 'react'
import { connect } from 'react-redux'
import {add} from "../store/reducer/userReducer"

export class Home extends Component<any,any> {
  render() {
    return (
      <div>Home{this.props.num}<button onClick={()=>{this.props.add(5)}}>+</button></div>
    )
  }
}

const mapStateToProps = (state:any) => ({
    num:state.userInfo.num
})

const mapDispatchToProps = {
    add
}

export default connect(mapStateToProps, mapDispatchToProps)(Home)